home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / utility / inied102.zip / INIEDIT.TXT < prev   
Text File  |  1991-09-05  |  20KB  |  502 lines

  1.  
  2.                              INIEDIT - Version 1.02
  3.  
  4.                   Copyright (C) Richard R. Sands CIS 70274,103
  5.                               All rights reserved
  6.  
  7.  
  8.                   Documentation last updated September 9, 1991
  9.  
  10.  
  11. OVERVIEW
  12. --------
  13.  
  14.    If you often find yourself editing your WIN.INI, SYSTEM.INI, or any
  15.    other INI file before you start Windows, then this program is for you!
  16.  
  17.    INIEDIT provides batch file editing of your INI files so you can start up
  18.    Windows with mnemonic commands.  This program reads a text file of editing
  19.    commands that instruct it to modify the various .INI files by section and
  20.    keywords.  You can change the contents of a line, delete lines, comment,
  21.    and uncomment them.  You may include several labeled sections in your
  22.    INIEDIT script so you can have all of your various Windows configurations
  23.    in one text file.
  24.  
  25.    Why did I write this program?  I have a portable that, at work, is
  26.    connected to a network, at home it's not.  When on the network, I have
  27.    several utilities I need to load, and although at home, they detect the 
  28.    lack of the network, I end up having to click a bunch of OK buttons.  I have 
  29.    customized system fonts that I like to use, but as a programmer, I like to 
  30.    boot windows with the "standard" font to check the dialog box metrics.  
  31.    Sometimes, I want to just start windows without having to load up all my 
  32.    favorite utilities - get in quick - get out quick.  I use different 
  33.    "shell" programs depending on what "type" of environment I want to be in.  
  34.    You get the picture. With INIEDIT all of these actions are easily (read 
  35.    I-Don't-Have-To-Remember-Anything) written into a menu or batch file.
  36.  
  37.    This program is best used in a batch file, or with your favorite Menuing
  38.    Program.
  39.  
  40.  
  41. SYSTEM REQUIREMENTS
  42. -------------------
  43.  
  44.    Microsoft Windows 3.x
  45.  
  46.    INIEDIT has been tested with all DOS Versions 2.11 through 5.0.  It's 
  47.    memory requirements depend on the size of your largest INI file (but 
  48.    limited to 4000 lines of text).
  49.  
  50.  
  51. STARTING INIEDIT
  52. ----------------
  53.  
  54.    IniEdit requires at least 1 parameter: The Script Filename.  This is a
  55.    normal ascii file that contains the commands you want to be executed.
  56.  
  57.    In addition you may place some Switch Options that modify the way
  58.    INIEDIT behaves.
  59.  
  60.    The formal syntax for starting INIEDIT is as follows:
  61.  
  62.             INIEDIT     <-- This will display version & help screen
  63.          or
  64.             INIEDIT filename.ext [labels] [options]
  65.  
  66.    where
  67.  
  68.          filename.ext   is the name of the text file that contains your
  69.                         editing commands.
  70.  
  71.          [labels]       are optional. A label designates one or more
  72.                         sections of your INIEDIT script to be executed.
  73.                         You may have more than 1 label on the command
  74.                         line.
  75.  
  76.          [options]      are optional, and must be preceded with a "/"
  77.                         character.  The options are:
  78.  
  79.                           /?     Displays version and help screen.
  80.  
  81.                           /B-    Disable backup files.  Normally, INIEDIT
  82.                                  will always backup your file up before
  83.                                  making any edits.
  84.  
  85.                           /D+    Enable "Debug" mode.  This will display each
  86.                                  line as it is executed with additional info
  87.                                  so you can track down any errors in your
  88.                                  logic.
  89.  
  90.                           /L+    Show a list of all labels found in the
  91.                                  INIEDIT script file.  This is useful if your
  92.                                  file requires a user-label entered on the
  93.                                  command line.  Your batch file can check
  94.                                  for a parameter, and if not found then issue
  95.                                  this switch.  This switch returns a DOS
  96.                                  Errorlevel of 1.
  97.  
  98.                           /P-    Don't pause for a key when an error occurs.
  99.                                  This is on by default.  You can check for
  100.                                  errors in your batch file with the DOS
  101.                                  errorlevel variable.
  102.  
  103.                           /W+    Show warnings and wait for a key to proceed.
  104.                                  This is off by default.  Warnings are
  105.                                  ususally available only in Debug Mode.
  106.  
  107.  
  108. EDITING COMMANDS
  109. ----------------
  110.  
  111.    All commands to INIEDIT are entered into a regular ascii text file created
  112.    with your favorite TEXT editor (or WP w/Text Out).
  113.  
  114.    There are six basic commands:
  115.  
  116.       COMMENT     This will make a keyword entry into a comment.
  117.       DELETE      This can delete a whole section or just one keyword.
  118.       EDIT        This will change the contents of a keyword entry.
  119.       EXIT        Quit processing the script file
  120.       INI         Opens an .INI file for editing
  121.       UNCOMMENT   This changes a commented line into a regular line.
  122.  
  123.  
  124.    Each command is written on it's own line.  Lines may not wrap, but may be
  125.    up to 255 characters (including leading blanks) long.  For each command,
  126.    you may write the whole command (eg. COMMENT) or just the first three
  127.    letters (eg. COM).
  128.  
  129.    For all commands except EXIT and INI, the syntax is identical.  You
  130.    include the command, the DOS Ini filename (path & .ext not required), the
  131.    section name enclosed in square brackets, and, the keyword/value pair
  132.    separated with an equal sign ("=").
  133.  
  134.    For example:
  135.  
  136.                  EDIT WIN [Windows] Beep=No
  137.  
  138.    This command will change the BEEP keyword under the [Windows] section of
  139.    the WIN.INI file to NO.
  140.  
  141.    Comments are lines starting with a semi-colon.  The line does not have
  142.    to start in column one.  Comments must be on their own line.  This is a
  143.    remark in the INIEDIT script file:
  144.  
  145.                  ; This is a valid remark
  146.  
  147.    Labels are used to "tag" sections of the INIEDIT script to be used with
  148.    a parameter sent from the command line.  This way you can have several
  149.    different configurations without having to have them in separate files (as
  150.    in INIEDIT Version 1.01).  Given a INIEDIT script with these two
  151.    sections:
  152.  
  153.              ; This is TEST.MOD  (the .MOD means MODifications)
  154.              :FAST
  155.                 EDIT Win Load=
  156.                 EDIT Win Run=
  157.                 EXIT
  158.              :SLOW
  159.                 EDIT Win Load=C:\AFTERDRK\AD NWSEND EMAIL RESGUAGE BIGDESK
  160.                 EDIT Win Run=SkeyWin YaClock
  161.                 EXIT
  162.  
  163.    Then having your batch file (or Menu) give this command:
  164.  
  165.               INIEDIT Test.Mod SLOW
  166.  
  167.    Will execute the section listed under ":SLOW" and this command:
  168.  
  169.               INIEDIT test.mod fast
  170.  
  171.    would execute the section listed under ":FAST".  Note the EXIT commands
  172.    at the end of each section.  If you don't have one, it will "fall"
  173.    through to the next section (which could be construed as a feature!).
  174.  
  175.    You can place more than one label on the command line.  This has the
  176.    effect of executing each section.  This command will execute two
  177.    sections:
  178.  
  179.               INIEDIT test.mod slow fast
  180.  
  181.    You may also have descriptions attached to your labels.  This is very
  182.    useful when the Show Labels switch is used (/L+):
  183.  
  184.              :FAST - Don't load any utilities
  185.              :SLOW - Load all utilities
  186.  
  187.    There are no flow-control statements.  The sequence of execution is
  188.    essentially linear.  I was tempted to put in a CALL/GOTO command but I
  189.    found it -really- wasn't needed.  So far, no one has complained.  If you
  190.    can give me a good situation where you would want one, I'll consider it
  191.    for the next release.
  192.  
  193.  
  194. A MOMENT OF REFLECTION
  195. ----------------------
  196.    As I wrote this program, I considered adding commands for creating and
  197.    executing some kind of menu system.  After some reflection, I decided
  198.    that the last thing the world needs is a new menu system.  If you really
  199.    need one, I can provide a simple DOS Batch File based system with color,
  200.    nested menus, etc. with all commands using regular batch file commands
  201.    and one small utility.  Again, if you think there is an overriding
  202.    reason for including these type of commands let me know and I'll consider
  203.    it for the next release.
  204.  
  205.  
  206. COMMAND ABBREVIATIONS
  207. ---------------------
  208.    INIEDIT Version 1.01 allowed the first three characters of the command to
  209.    be used rather than the whole command (eg. COM for COMMENT).  This is
  210.    still enabled, but in lieu of future versions, you are encouraged to use
  211.    the whole command.
  212.  
  213.  
  214. SAMPLE BATCH FILES
  215. ------------------
  216.  
  217.    This batch file will start Windows after modifying the various INI files
  218.    that I need.  It first checks for no parameters, and if none, displays
  219.    all the labels in the file.  Otherwise it executes the INIEDIT program
  220.    and checks for any errors.  If no errors then windows is started.
  221.  
  222.       @Echo Off
  223.         C:
  224.         cd C:\WIN
  225.         if %1!==! GOTO Error              (check for required parameter)
  226.         INIEDIT WinBoot.Mod %1 %2 %3      (allow user to specify labels)
  227.         if ERRORLEVEL 1 GOTO Done         (check for any errors)
  228.         Win                               (start Windows)
  229.         GOTO Done                         (and quit)
  230.       :Error
  231.         INIEDIT WinBoot.Mod /L+           (display list of labels)
  232.       :Done
  233.  
  234.  
  235. THE FUTURE OF INIEDIT
  236. ---------------------
  237.    I don't think INI files are going to go away, so this program should be
  238.    useful for the next few versions of Windows.
  239.  
  240.    Some suggestions that I have not implemented (yet) are some control
  241.    commands (eg. GOTO or CALL), some substring handling for modifing portions
  242.    of a keyword (eg. remove "clock" from LOAD=Calc Clock Bye),  some screen
  243.    handling commands for creating prompts/menus, and mulitple user label
  244.    parameters so you don't have to use SHIFT in your batch files.
  245.  
  246.    I've even had a request for an OS/2 version.
  247.  
  248.    Depending on additional interest, these types of commands, or other
  249.    commands could very well appear on future releases of INIEDIT.
  250.  
  251.  
  252. COMMAND REFERENCE
  253. -----------------
  254.  
  255.    Manual Conventions
  256.  
  257.       Because the use of the [] symbols to denote sections, I will write
  258.       required values in uppercase.
  259.  
  260.                 EDIT win [section] KEYWORD=value
  261.  
  262.  
  263.       All keywords must have an equal sign after them even if nothing
  264.       follows.
  265.  
  266.                 EDIT Win [Windows] Run=
  267.  
  268.  
  269.    --------------------------------------------------------------------------
  270.                                                                       COMMENT
  271.    COMMENT ini [section] KEYWORD=value
  272.  
  273.    Changes the section/line containing the keyword to be a comment.  This is
  274.    a non-destructive way of "deleting" keyword entries.  The value entry is
  275.    ignored.
  276.  
  277.    If no [section] is provided, then it changes the value of the first
  278.    keyword under -any- section that matches.  See the EDIT entry.
  279.  
  280.    Keywords not found are "soft" errors and ignored by INIEDIT.
  281.  
  282.    Examples:
  283.         COMMENT System [boot.description] network.drv=
  284.         COMMENT System [386Enh] network=*vnetbios, vnetware.386, vipx.386
  285.         COMMENT Win [Clock]
  286.  
  287.  
  288.    --------------------------------------------------------------------------
  289.                                                                        DELETE
  290.    DELETE ini [SECTION] KEYWORD=value
  291.  
  292.    Deletes a keyword from the active ini file.  If the keyword is not given,
  293.    then it deletes the whole section from the ini file.  Note that you must
  294.    supply [section] AND/OR keyword.
  295.  
  296.    NOTE: This is a hold-over from INIEDIT Version 1.01.  It is best that you
  297.          use COMMENT/UNCOMMENT rather than DELETE.
  298.  
  299.    If no [section] is provided, then it changes the value of the first
  300.    keyword under -any- section that matches.  See the EDIT entry.
  301.  
  302.    Examples:
  303.              DELETE Win [Clock]
  304.              DELETE Win [Clock] iFormat=
  305.              DELETE Win [Clock] iFormat=1
  306.              DELETE Win iFormat=1
  307.  
  308.  
  309.    --------------------------------------------------------------------------
  310.                                                                          EDIT
  311.    EDIT ini [section] KEYWORD=value
  312.  
  313.    Changes (or adds) the contents of the keyword under the [section] heading.
  314.    If no [section] is provided, then it changes the value of the first
  315.    keyword under -any- section that matches.  You might be safe saying:
  316.  
  317.          EDIT Win Load=Clock
  318.  
  319.    But you might have problems with a command like:
  320.  
  321.          EDIT Win iFormat=0
  322.  
  323.    Because several programs use the iFormat keyword, and you could be -sure-
  324.    that the iFormat you meant was changed.  It would be better to write a
  325.    statement like:
  326.  
  327.          EDIT win [Clock] iFormat=0
  328.  
  329.    While in debug mode (/D+) you may see "warnings" like "keyword not found".
  330.    These are "soft" errors, INIEDIT will add the keyword AND section if it
  331.    does not exist.
  332.  
  333.    Examples:
  334.  
  335.             EDIT system [boot] shell=msdos.exe
  336.             EDIT win [desktop] WallPaper=G:\BITMAPS\MMONROE.BMP
  337.  
  338.  
  339.    --------------------------------------------------------------------------
  340.                                                                          EXIT
  341.    EXIT
  342.  
  343.    Terminates the execution of the script.
  344.  
  345.    This is typically used when you want only a certain portion of a script to
  346.    be executed.  Script sections always have a label to designate the section
  347.    (except, possibly, for the first section).
  348.  
  349.    EXIT is not required if the section is the last section in the file.
  350.  
  351.    Example:
  352.             :Label1
  353.                edit win [clock] iformat = 1
  354.                EXIT
  355.             :Label2
  356.                edit win [clock] iformat = 0
  357.  
  358.  
  359.    --------------------------------------------------------------------------
  360.                                                                           INI
  361.    INI
  362.  
  363.    Opens an .INI file for editing.
  364.  
  365.    This is typically used at the start of a section.  It is an optional
  366.    command since you can include the INI file on the line of each command.
  367.  
  368.    Example:
  369.             :Label1
  370.                INI Win
  371.                edit [clock] iformat = 1
  372.                edit [desktop] WallPaper = Cube.Bmp
  373.                EXIT
  374.  
  375.  
  376.    --------------------------------------------------------------------------
  377.                                                                     UNCOMMENT
  378.    UNCOMMENT ini [section] KEYWORD=value
  379.  
  380.    Changes the commented line or section containing the section/keyword to be
  381.    an active statement.  This is the compliment of the COMMENT command.  The
  382.    value entry is ignored.
  383.  
  384.    If no [section] is provided, then it changes the value of the first
  385.    keyword under -any- section that matches.  See the EDIT entry.
  386.  
  387.    Keywords not found are "soft" errors and ignored by INIEDIT.
  388.  
  389.    Examples:
  390.         UNCOMMENT System [boot.description] network.drv=
  391.         UNCOMMENT System [386Enh] network=*vnetbios, vnetware.386, vipx.386
  392.         UNCOMMENT Win [Clock]
  393.  
  394.  
  395. ERROR MESSAGES
  396. --------------
  397.  
  398.    There are two levels of errors: Soft and Hard.  Soft errors are warnings.
  399.    Soft errors are (ususally) ignored during normal execution of the program,
  400.    they are only reported during Debug Mode (/D+) or if you have the Show
  401.    Warnings switch (/W+) active.  They do not stop the program.  Hard errors
  402.    will stop the program and won't make any changes to the current INI file.
  403.    If a Hard Error occurs, then the program will wait for a key to be pressed
  404.    unless the user has specified No Pause On Error (/P-).
  405.  
  406.  
  407.    File not found: d:\path\filename.INI
  408.         Attempt to open an .INI file that does not exist.  Check the path of
  409.         the filename and spelling.
  410.  
  411.    File not open: d:\path\filename.INI
  412.         An attempt was made to write an INI file that was not opened.  Check
  413.         the path of the filename and spelling.
  414.  
  415.    Label "xxxx" not found
  416.         A label parameter supplied on the command line was not included in
  417.         the INIEDIT script file.
  418.  
  419.    No INI file opened!
  420.         A command is about to be executed (any command but EXIT) and there
  421.         is no INI file opened.  Include the INI filename, at least, on the
  422.         first statement of each section.
  423.  
  424.    Parameter file not found: d:\path\filename.ext
  425.         This means you gave an incorrect filename to be used as the INIEDIT
  426.         script.  INIEDIT makes no assumptions about the file extension you
  427.         used.  Also, check the path of the filename.
  428.  
  429.    Too many lines in d:\path\filename.INI
  430.         The INI file you have tried to edit has grown too large.  INIEDIT
  431.         can only edit files up to 4000 lines long.  (If you have a INI file
  432.         that gets this error, I'd like to see it!)
  433.  
  434.    Too many user parameters
  435.         You are allowed 15 "User Parameters" to the INIEDIT program.  I think
  436.         this should be sufficient for 99% of all uses<g>.
  437.  
  438.    Unknown identifier: xxx
  439.         An unknown command has been encountered in the INIEDIT script file.
  440.         Check your spelling.
  441.  
  442.    Unknown Switch: /x
  443.         You have included a switch that INIEDIT does not understand on the
  444.         command line.  Check your batch file / Menu.
  445.  
  446.    You must include a filename
  447.         You must include a filename on the command line to INIEDIT.  INIEDIT
  448.         does not make any assumptions about what file extension you have
  449.         used.
  450.  
  451.    Runtime Errors 200-203
  452.         These are Turbo Pascal errors and generally mean you have run out of
  453.         memory for the program's data.  This should not happen if you are
  454.         going into Windows.  If it does, it would me that you really don't
  455.         have enough memory to go into Windows.  Check and make sure that you
  456.         are not "shelled" out of another program.
  457.  
  458.  
  459. LEGAL & REGISTRATION STUFF
  460. --------------------------
  461.  
  462.     This program is supplied "As Is".  I make no claims about the suitability
  463.     of this software on your computer system.  I cannot be held liable for
  464.     any claims that are not supported (bugs) nor for any misuse of this
  465.     program, nor for any damage that may result of using this program.
  466.  
  467.     You may freely distribute the INIEDIT.EXE and INIEDIT.TXT files as long
  468.     as INIEDIT.EXE is unregistered (Version 1.02s).  You may not modify the
  469.     INIEDIT.EXE or INIEDIT.TXT files in any way.
  470.  
  471.     This is User-Supported software.  A lot of work went into writing this
  472.     package.  If you find this program useful, please send us $20.00 per copy
  473.     or $100 per 10 copies (other deals can be made!).  In return, you will
  474.     get the latest copy of the program (with no reminder notices), laser
  475.     printed documentation, and notification of new updates.  You WILL get
  476.     notified - I keep a database of all registered users.
  477.  
  478.     Whether you are registered or not, I am wide open to any enhancements you
  479.     might offer, bug reports (not MY programs!), or any comments about
  480.     anything at all.  Best way to do this is to Mail me via CIS.
  481.  
  482.  
  483.     Please send check to
  484.                          Richard Sands
  485.                          P.O. Box 3917
  486.                          Portland, Oregon  97208
  487.  
  488.     Please include the following information with your order:
  489.  
  490.               Your Name
  491.               Your Address
  492.               The Registration Name (eg. Company, Department, or Name)
  493.               Where you found the program (BB, CIS, Friend, etc)
  494.               Your CIS number if applicable
  495.  
  496.     Thanks for your support!
  497.  
  498.     Rick Sands
  499.  
  500. <end of doc>
  501.  
  502.